Skip to content

Instantly share code, notes, and snippets.

@dmdboi
dmdboi / discord_oauth.js
Created September 20, 2020 13:08
Two functions to authenticate a Discord User and get User's data
var axios = require('axios');
var qs = require('qs');
exports.getAccessToken = (code) => {
var data = qs.stringify({
'client_id': '',
'client_secret': '',
'grant_type': 'authorization_code',
'code': code,
'redirect_uri': '',

Proxmox VE Installation on Hetzner Server via Rescue System

Follow these steps to install Proxmox VE on a Hetzner server via the Rescue System. The Rescue System is a Linux-based environment that can be booted into to perform system recovery tasks. We'll be using it to install Proxmox VE.

In order to complete the process, it is indeed necessary to first boot into the Rescue System and then connect to it via SSH. This will allow you to run the commands for installing Proxmox VE. Here are the steps:

Starting the Rescue System

  1. Log into the Hetzner Robot.
  2. Under "Main Functions; Server" select the desired server and then open the tab "Rescue".
@Yanivmd
Yanivmd / LateX Diff with Overleaf
Last active May 18, 2024 10:27
LateX Diff with Overleaf
Follow this:
https://github.com/comaniac/latex-proj-tool
After install, you do:
python3 -m latex_proj_tool flat old_project/main.tex --output old.tex
main.tex points to main file, the script will find the rest.
For latexdiff, use this online tool:
https://3142.nl/latex-diff/
@napsternxg
napsternxg / LatexDiffOverleaf.md
Last active May 18, 2024 10:26
Doing diff for latex projects on Overleaf

Steps for doing latexdiff

  • Download 2 versions from overleaf
  • Compile them using the TexStudio. I should create a bbl file.
  • Create a new tex file where you replace the bibliography section with the contents of the bbl file.
  • Do the same for the other version of the file.
  • Check that the new tex file for both version compiles to the same contents of the original tex files.
  • Open https://3142.nl/latex-diff/ and paste the contents of the new tex files from both versions in the text boxes.
  • Click the box named "Generate LateX document showing differences"
  • It will take some time and then create the diff file.
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 18, 2024 10:20
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@saibotsivad
saibotsivad / downthemall.sh
Created December 29, 2015 16:45
Download all these free math books!
#!/bin/bash
wget http://link.springer.com/content/pdf/10.1007/978-1-4757-1779-2.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4757-2103-4.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4684-9884-4.pdf
wget http://link.springer.com/content/pdf/10.1007/978-3-662-02945-9.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4612-9923-3.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4757-3828-5.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4684-9936-0.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4419-8566-8.pdf
@msnazarow
msnazarow / Image+Trim.swift
Last active May 18, 2024 10:16 — forked from chriszielinski/Image+Trim.swift
[Swift 5] NSImage/UIImage Crop/Trim Transparency
// Image+Trim.swift
//
// Copyright © 2020 Christopher Zielinski.
// https://gist.github.com/chriszielinski/aec9a2f2ba54745dc715dd55f5718177
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@karthiks
karthiks / wsl-cheatsheet.ps1
Last active May 18, 2024 10:15
WSL 2 CLI Cheat-sheet To Be Run In Powershell
# To list installed distributions
wsl -l
wsl --list
# To list installed distributions along with its running status and wsl config being 1 or 2
wsl -l --verbose
wsl -l -v
# To run a specific distro
wsl -d distro_name
@judge2020
judge2020 / plot_discord_predictions.py
Created May 18, 2024 04:05 — forked from rebane2001/plot_discord_predictions.py
Simple script to plot your Discord machine-learning predicted age and gender from the data dump.
import glob
import json
from datetime import datetime
from matplotlib import pyplot
age_ts = []
age_keys = ["prob_13_17", "prob_18_24", "prob_25_34", "prob_35_over"]
age_lists = {k:[] for k in age_keys}
gen_ts = []
float getTemp(){
//wait until predefined amount between IC request.
//Dont constantly request, the chip will heat up.
if(millis() - previousTempReading < tempReadingInterval){
Serial.println("Passing temperature reading. This is not the time.");
return;
}
//We cant just request and receive the temperature reading. It takes time on DS18B20 devices.
//For 12bit precision it takes 750ms to finish conversion.
//Only usable for first device on the line